package com.jdk.demo.nio.bilibili.Maodun.net.qiujuer.library.clink.box;

import java.io.IOException;

import com.jdk.demo.nio.bilibili.Maodun.net.qiujuer.library.clink.core.ReceivePacket;

public class StringReceivePacket extends ReceivePacket {

	private byte[] buffer;
	private int position;

	public StringReceivePacket(int len) {
		this.buffer = new byte[len];
		this.length = len;
	}

	@Override
	public void save(byte[] bytes, int count) {
		System.arraycopy(bytes, 0, buffer, position, count);
		position += count;
	}

	public String string() {
		return new String(buffer);
	}

	@Override
	public void close() throws IOException {

	}

}
